package com.woniuxy.businessassembly.dao;

import com.woniuxy.businessassembly.model.HotelSettle;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Kevin Kwok
 * @since 2021-05-24
 */
@Mapper
public interface HotelSettleMapper extends BaseMapper<HotelSettle> {
    @Insert("insert into hotel_settle (hotel_name,hotel_addr,certification_url,principal_tel,principal_password,status) values(#{hotelName},#{hotelAddr},#{certificationUrl},#{principalTel},#{principalPassword},#{status})")
    int newBusiness(HotelSettle settle);

    /*查询指定酒店的所有的申请信息*/
    @Select("select * from hotel_settle where hotel_name=#{hotelName}")
    HotelSettle queryCheckInfo(String hotelName);

    /*修改酒店的审核状态*/
    @Update("update hotel_settle set status=1 where hotel_name=#{hotelName}")
    int modifyCheckStatus(String hotelName);


}
